using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class data_to_insert_into_viewcommands1Map : EntityTypeConfiguration<data_to_insert_into_viewcommands1>
    {
        public data_to_insert_into_viewcommands1Map()
        {
            // Primary Key
            this.HasKey(t => new { t.View, t.Object, t.CommandTittle, t.Command, t.Paramfield1, t.Paramfield2, t.order, t.Group, t.options });

            // Properties
            this.Property(t => t.View)
                .IsRequired()
                .HasMaxLength(7);

            this.Property(t => t.Object)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.CommandTittle)
                .IsRequired()
                .HasMaxLength(11);

            this.Property(t => t.Command)
                .IsRequired()
                .HasMaxLength(4);

            this.Property(t => t.Paramfield1)
                .IsRequired()
                .HasMaxLength(2);

            this.Property(t => t.Paramfield2)
                .IsRequired()
                .HasMaxLength(1);

            this.Property(t => t.order)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Group)
                .IsRequired()
                .HasMaxLength(1);

            this.Property(t => t.options)
                .IsRequired()
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("data_to_insert_into_viewcommands1");
            this.Property(t => t.View).HasColumnName("View");
            this.Property(t => t.Object).HasColumnName("Object");
            this.Property(t => t.CommandTittle).HasColumnName("CommandTittle");
            this.Property(t => t.Command).HasColumnName("Command");
            this.Property(t => t.Paramfield1).HasColumnName("Paramfield1");
            this.Property(t => t.Paramfield2).HasColumnName("Paramfield2");
            this.Property(t => t.order).HasColumnName("order");
            this.Property(t => t.Group).HasColumnName("Group");
            this.Property(t => t.options).HasColumnName("options");
        }
    }
}
